package 多线程.Runnable;

public class MyRunnableDemo {
    public static void main(String[] args) {
        MyRunnable mb = new MyRunnable();

        //创建thread对象,把runnable对象作为构造方法的参数
//        Thread t1 = new Thread(mb);
//        Thread t2 = new Thread(mb);

//        Thread(Runnable target, String name)
        Thread t1 = new Thread(mb,"高铁");
        Thread t2 = new Thread(mb,"飞机");
        //启动线程
        t1.start();
        t2.start();
    }
}
